Hi,
I need a duplicate check for a custom entity. I read all posts about this subject, worked through the docs, but whatever I try, I always get error 500, nothing in the log-file.
I have a custom entity (BasePlus), where I want to duplicate check the "name" field. The name of the entity is "Werke"
Here is the code I tried (following the docs):
Help is appreciated, thank you.
I need a duplicate check for a custom entity. I read all posts about this subject, worked through the docs, but whatever I try, I always get error 500, nothing in the log-file.
I have a custom entity (BasePlus), where I want to duplicate check the "name" field. The name of the entity is "Werke"
Here is the code I tried (following the docs):
Code:
<?php
namespace Espo\Custom\Classes\DuplicateWhereBuilders;
use Espo\Core\Duplicate\WhereBuilder;
use Espo\ORM\Query\Part\Condition as Cond;
use Espo\ORM\Query\Part\WhereItem;
use Espo\ORM\Query\Part\Where\OrGroup;
use Espo\ORM\Entity;
class Werke implements WhereBuilder
{
protected function getDuplicateWhereClause(Entity $entity, $data)
{
if (!$entity->get('name')) {
return false;
}
return [
'name' => $entity->get('name')
];
}
}


Comment